#pragma once

#include <cstddef>
#include <memory>

namespace rewine
{

class MapIndicator {
public:

    std::shared_ptr<int> pfd;

    const void * start;
    std::size_t offset;
    std::size_t size;

    std::size_t pos;
    std::size_t carry;

public:

    MapIndicator(const std::shared_ptr<int> &pfd, const void * start, std::size_t offset, std::size_t size);
    MapIndicator() : MapIndicator(nullptr, nullptr, 0, 0) {}

    void * front() const;
    void * back() const;
    void * current() const;

    void * jump(std::size_t pos, std::size_t carry);
    void * move(std::size_t offset, std::size_t carry);
    void * next(std::size_t carry);
    void * rewind();

};

} // namespace rewine
